package work.work_02.oop;


/**
 * @author: lys
 * @类名: SalariedEmployee
 * @Title:
 * @date: 2020/7/15
 **/
public class SalariedEmployee extends ColEmployee {
    //定义属性
    private double empMoney;

    //构造方法
    public SalariedEmployee(){}
    public SalariedEmployee(String empName,int empMonth,double empMoney){
        super(empName,empMonth);
        this.empMoney = empMoney;
    }

    //getSalary方法,本月过生日时的员工工资
    public double getSalary(int month){
        if(month == super.getEmpMonth()){
            return empMoney+100;
        }else{
            return empMoney;
        }
    }

    //getter和setter方法
    public double getEmpMoney() {
        return empMoney;
    }

    public void setEmpMoney(double empMoney) {
        this.empMoney = empMoney;
    }
}
